<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'incricaoCadastroPass.label', default: 'IncricaoCadastroPass')}" />
  <title>
    <g:message code="default.show.label" args="[entityName]" />
  </title>
</head>
<body>
<g:form   method="post" >
  <input name="id" value="${params?.id}" type="hidden">
  <input name="chave" value="${params?.chave}" type="hidden">
  <input name="inscricao.id" value="${incricaoCadastroPassInstance?.id}" type="hidden">
  <br>
  <table class="datagrid">
    <thead>
      <tr>
        <th>PASS</th>
        <th>ITENS PREENCHIDOS</th>
        <th>CONFIRMAÇÃO</th>
      </tr>
    <thead>
    <tbody>
      <tr>
        <td><g:if test="${incricaoCadastroPassInstance.submetePass == true }" > PASS ENVIADO EM
      <g:formatDate date="${incricaoCadastroPassInstance.dataEnvioPass}"  format="dd/MM/yyyy"/>
      AS
      <g:formatDate date="${incricaoCadastroPassInstance.dataEnvioPass}" type="time" style="SHORT"/>
    </g:if>
    <g:else>
      <g:link action="create" controller="incricaoCadastroPass"  params="[id:params.id ,'inscricao.id' :incricaoCadastroPassInstance.id ,chave:params.chave]">PREENCHER PASS</g:link>
    </g:else>
    </td>
    
    <td><g:if test="${incricaoCadastroPassInstance.submetePass == true }" > <img   src="/contratualizacao/images/ok.png" ></img> </g:if>
    <g:else>
      bla bla bla: ${incricaoCadastroPassInstance.incricaoCadastroPassGrupoPai}
      <%--g:if test="${!incricaoCadastroPassInstance.incricaoCadastroPassGrupoPai.itens.sum().contains('0')}">
        <td><g:link action="confirmaPass" controller="incricaoCadastroPass"  params="[id:params.id ,'inscricao.id' :incricaoCadastroPassInstance.id ,chave:params.chave]">Finalizar PASS</g:link>
      </g:if--%>
    </g:else>
    </td>
    <tr>
      </tbody>
  </table>
  <%--table class="datagrid">
    <g:if test="${incricaoCadastroPassInstance?.incricaoCadastroPassGrupoEspecifico}"  >
      <thead>
        <tr>
          <th>ESPECIALIDADE</th>
          <th>ITENS PREENCHIDOS</th>
          <th>CONFIRMAÇÃO</th>
        </tr>
      </thead>
      <tbody>
      <g:each in="${incricaoCadastroPassInstance.incricaoCadastroPassGrupoEspecifico.findAll{it.ativo == true}.sort{it.especifico}}" var="banco" >
        <tr>
          <td><g:if test="${banco.submetePassEspecifico == true }" > ${IncricaoCadastroPass.especificos(banco.especifico)} - ENVIADO EM
          <g:formatDate date="${banco.dataEnvioPassEspecifico}"  format="dd/MM/yyyy"/>
          AS
          <g:formatDate date="${banco.dataEnvioPassEspecifico}" type="time" style="SHORT"/>
        </g:if>
        <g:else>
          <g:link action="createEspecifico" controller="incricaoCadastroPass" id="${banco?.id}" params="[chave:params.chave]">${IncricaoCadastroPass.especificos(banco.especifico)}</g:link>
        </g:else>
        </td>
        
        <td><g:if test="${banco.submetePassEspecifico == true }" > <img   src="/contratualizacao/images/ok.png" ></img> </g:if>
        <g:else>
          <g:if test="${IncricaoCadastroPassGrupoEspecifico.verificaSeExisteItemNaoPreenchido(banco?.id) == true}">
            <g:link action="confirmaEspecifico" controller="incricaoCadastroPass" id="${banco?.id}" params="[chave:params.chave]">Finalizar Envio</g:link>
          </g:if>
        </g:else>
        </td>
        </tr>
      </g:each>
    </g:if>
    <tr>
      <td colspan="3"><div class="col_1" style="width: 120px">
          <g:actionSubmit action="escolheEspecifico" controller="incricaoCadastroPass" type="submit" class="cmd green save" style="background-color: orange ; font-weight: bolder ; cursor: pointer" value="Selecionar Especialidade"   />
        </div>
      </td>
    </tr>
    </tbody>
  </table--%>
</g:form>
</body>
</html>
